import logging,yagmail

def log():
    log = logging.basicConfig(
        level=logging.DEBUG,
        filename=r'E:\gg4\gaoliu\month_web_1110\log/baidu.log',
        filemode='a+',
        format='%(levelname)s-%(filename)s-%(asctime)s-%(message)s-%(lineno)d'
    )
    return log

def mail():
    mail = yagmail.SMTP(user='3080172040@qq.com',password='abhdfnpkqkmadgff',host='smtp.qq.com')
    mail.send(
        to='3080172040@qq.com',
        subject='百度自动化测试',
        contents=['百度自动化测试,请查收',
                  r'E:\gg4\gaoliu\month_web_1110\log/baidu.log',
                  r'E:\gg4\gaoliu\month_web_1110\report\baidu.html',
                  r'E:\gg4\gaoliu\month_web_1110\report\baidubg\index.html']
    )